
<%@ page contentType="text/html; charset=UTF-8"%>

<!DOCTYPE html>

<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Hello</title>
</head>
<body>
<button id="order">点击下单</button>

</body>
</html>



<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.js"></script>

<script type="application/javascript">
    $("#order").click(function(){
        $.ajax({
            url:"/order",
            type:"POST",
            success: function(result){
                //跳转到支付页
                if(result.code == 0) {
                    window.location.href = '/paypage/' + result.data;
                }
            }
        });
    });

</script>